# -*- coding:utf-8 -*-
# 选择排序

def select_sort(list):
    l = len(list)
    if l < 2:
        return list
    
    for i in range(l):
        min = list[i]
        for j in range(i + 1, l):
            if list[j] < min:
                min, list[j] = list[j], min
        list[i] = min

    return list


def select(list):
    l = len(list)
    if l < 2:
        return list
    
    for i in range(l):
        for j in range(i + 1, l):
            if list[j] < list[i]:
                list[i], list[j] = list[j], list[i]

    return list


list = [54, 26, 93, 17, 77, 3, 31, 44, 55, 20]
print(select(list))